#ifndef QGETVERSION_H
#define QGETVERSION_H

#include <QObject>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QUrl>
#include <QTimer>
#include <QDateTime>

class QGetVersion : public QObject
{
    Q_OBJECT
public:
    explicit QGetVersion(QObject *parent = 0);
    ~QGetVersion();
    bool    start(const QUrl &url);
    void    stop();
signals:
    void    offline();
    void    finish(const QByteArray &data);
public slots:
    void    finished();
    void    readyRead();

    void    timer();

protected:
    QNetworkAccessManager   m_manager;
    QNetworkReply           *m_reply;
    QByteArray              m_data;
    QTimer                  *m_timer;
    QDateTime               m_last_time;

};

#endif // QGETVERSION_H
